Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace vsock helper server with socat and related changes #4125

Merged
merged 8 commits into from
Sep 22, 2023

Conversation

kalyazin
Copy link
Contributor

Changes

These changes are supposed to improve vsock tests' stability by:

  • using socat instead of hand-written vsock echo server in the guest
  • adding a delay after starting the server
  • avoiding using multiple instances of the server at the same time
  • using smaller blob for exchange where a large one is not required

Reason

vsock-related tests are not stable.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following
Developer Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • [ ] If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • [ ] Any required documentation changes (code and docs) are included in this PR.
  • [ ] API changes follow the Runbook for Firecracker API changes.
  • [ ] User-facing changes are mentioned in CHANGELOG.md.
  • [ ] All added/changed functionality is tested.
  • [ ] New TODOs link to an issue.
  • Commits meet contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (5c37410) 82.27% compared to head (28a857d) 82.27%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4125   +/-   ##
=======================================
  Coverage   82.27%   82.27%           
=======================================
  Files         225      225           
  Lines       28470    28470           
=======================================
  Hits        23423    23423           
  Misses       5047     5047           
Flag Coverage Δ
4.14-c7g.metal 77.70% <ø> (ø)
4.14-m5d.metal 79.57% <ø> (ø)
4.14-m6a.metal 78.69% <ø> (ø)
4.14-m6g.metal 77.70% <ø> (ø)
4.14-m6i.metal 79.57% <ø> (ø)
5.10-c7g.metal 80.61% <ø> (ø)
5.10-m5d.metal 82.25% <ø> (ø)
5.10-m6a.metal 81.46% <ø> (ø)
5.10-m6g.metal 80.61% <ø> (ø)
5.10-m6i.metal 82.24% <ø> (ø)
6.1-c7g.metal 80.61% <ø> (ø)
6.1-m5d.metal 82.25% <ø> (ø)
6.1-m6a.metal 81.46% <ø> (ø)
6.1-m6g.metal 80.61% <ø> (ø)
6.1-m6i.metal 82.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kalyazin kalyazin marked this pull request as ready for review September 21, 2023 20:24
@kalyazin kalyazin self-assigned this Sep 21, 2023
@kalyazin kalyazin added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Sep 21, 2023
pb8o
pb8o previously approved these changes Sep 22, 2023
Copy link
Contributor

@pb8o pb8o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, some minor comments you could add if you do another revision.

tests/framework/utils_vsock.py Outdated Show resolved Hide resolved
tests/integration_tests/functional/test_snapshot_basic.py Outdated Show resolved Hide resolved
This is to avoid code duplication.

Signed-off-by: Nikita Kalyazin <[email protected]>
This is to reduce likelihood of bugs by reducing
the amount of hand-written test code,
in this case vsock echo server on the guest.

See a similar change:

commit bfa0dc7
Author: Pablo Barbáchano <[email protected]>
Date:   Wed Jun 7 22:04:38 2023 +0200

    test: change the echo server in test_5_snapshots

Signed-off-by: Nikita Kalyazin <[email protected]>
This is to avoid a situation where clients
do not get reply after they send a connect message,
like this:

framework/utils_vsock.py:197: in _vsock_connect_to_guest
    ack_buf = sock.recv(32)
E   Failed: Timeout >300.0s

Signed-off-by: Nikita Kalyazin <[email protected]>
In negative vsock tests, a guest echo server
was started both independently and inside
check_host_connections() leading to multiple
instances running in the guest at the same time.

This commit removes starting the server inside
check_host_connections(). This makes it inconsistent
with check_guest_connections() that still starts
a host echo server internally, but removing it
is not currenlty warrranted.

Signed-off-by: Nikita Kalyazin <[email protected]>
Move the check that metrics contain an expected sigpipe count
closer to the code that triggers the sigpipe signal.

This will make it easier to diagnose potential issues
related to check_host_connections() logic in the future.

Signed-off-by: Nikita Kalyazin <[email protected]>
A large blob size (20M) is used in the first part of the test
to increase likelihood of triggering the epipe condition.
In the second part of the test, a call to
check_host_connections() is performed to verify that Firecracker
can still operate after receiving a sigpipe.
There is no need to use a large blob size in the second
part.

This commit gets back to the default blob size
in the second part of the test to reduce the test duration.

Signed-off-by: Nikita Kalyazin <[email protected]>
Calculation of the path is usually done by the calling code
anyway.

Signed-off-by: Nikita Kalyazin <[email protected]>
Copy link
Contributor

@roypat roypat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ngl, I'm fairly baffled by that SIGPIPE test, but the changes make sense to me ah, I see now, we're not testing that firecracker gets a SIGPIPE, we're testing that the SIGPIPE doesnt cause firecracker to exit: #2462

@kalyazin kalyazin merged commit 840cbd9 into firecracker-microvm:main Sep 22, 2023
5 checks passed
@kalyazin kalyazin deleted the vsock branch September 22, 2023 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting review Indicates that a pull request is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants